//
//  GZUserLogin.swift
//  GZMarathon
//
//  Created by apple on 2021/10/19.
//

import UIKit
import HandyJSON

class GZUserData: NSObject, HandyJSON , NSCoding{
    var account_avatar: String = ""
    var account_name: String = ""
    var account_phonenum: String = ""
    var account_username: String = ""
    var token: String = ""
    var im_url: String = ""
    var account_type = ""//"1": "急救人员", "2": " 驾驶员", "3": "防疫人员"

    ///序列化一个对象的时候使用
        func encode(with aCoder: NSCoder) {
            aCoder.encode(account_avatar.self, forKey: account_avatar)
            aCoder.encode(account_name, forKey: account_name)
            aCoder.encode(account_phonenum, forKey: account_phonenum)
            aCoder.encode(account_username,forKey: account_username)
            aCoder.encode(token, forKey: token)
            aCoder.encode(account_type, forKey: account_type)

        }
        ///反序列化的时候用
        required init?(coder aDecoder: NSCoder) {
            account_avatar = aDecoder.decodeObject(forKey: account_avatar) as! String
            account_name = aDecoder.decodeObject(forKey: account_name) as! String
            account_phonenum = aDecoder.decodeObject(forKey: account_phonenum) as! String
            account_username = aDecoder.decodeObject(forKey: account_username) as! String
            token = aDecoder.decodeObject(forKey: token) as! String
            account_type = aDecoder.decodeObject(forKey: account_type) as! String

        }

    
    public required override init(){}
}

class GZUserLogin:NSObject,  HandyJSON {
    
    var code: String = ""
    var message: String = ""
    var data: GZUserData = GZUserData()
    public required override init(){}
}
